home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 74 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.6 KB

  1. Path: fido.asd.sgi.com!austern
  2. From: David Byrden <100101.2547@compuserve.com>
  3. Newsgroups: comp.std.c++
  4. Subject: STL experts, please comment
  5. Date: 19 Jan 1996 09:32:09 PST
  6. Organization: self-employed
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <4dnteb$6fo@news.bridge.net>
  9. NNTP-Posting-Host: isolde.mti.sgi.com
  10. X-Original-Date: 19 Jan 1996 10:57:15 GMT
  11. X-Mailer: Mozilla 1.1N (Windows; I; 16bit)
  12. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  13.     iQBVAwUBMP/VpUy4NqrwXLNJAQHFXgH7BGw0o9j8b5usu698YCJU10gRtMGy62Wf
  14.     mhWf02bkqf2wYlNlWFSmRPMQbFGBNHo5NPmq+fbq1tK3Ymfde2MU5g==
  15.     =qvZT
  16. Originator: austern@isolde.mti.sgi.com
  17.  
  18. I'm trying to define an allocator and I have run into a problem.
  19.  
  20. In the HP STL, deque::iterator has a default ctor which initialises
  21. several of its members with the value 0
  22.  
  23.     iterator() : current(0), first(0), last(0), node(0) {}
  24.  
  25. These members have the type deque::pointer, which is a typedef
  26. for the pointer in deque's allocator.
  27.  
  28. An allocator pointer, according to the standard, has exactly the same
  29. semantics as a random access iterator.
  30.  
  31. I can find no place where it says that all random access iterators 
  32. should be constructable from the int value zero, neither in 
  33. documentation from the time of the HP STL, nor the latest draft standard.
  34.  
  35. So, this ctor seems to break the rules. Yet it was written by the 
  36. inventors of STL.
  37.  
  38. Any contributions?
  39.  
  40.  
  41.  
  42.              David
  43. ---
  44. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  45.   Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  46.   is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
  47.